<template>
  <div class="app-container home">
    <div class="compact-hero">
      <div class="hero-content">
        <h1 class="gradient-text">Classify<span>AI</span></h1>
        <p class="slogan">智能文档分类引擎</p>
        <p class="description">
          基于深度学习的文献自动分类系统，<br>
          让您的文件管理从未如此高效
        </p>
        <el-button type="primary" size="large" @click="$router.push('/literature/literature/index')"
          class="explore-btn pulse">
          <i class="el-icon-upload"></i> 开始体验
        </el-button>
      </div>

      <div class="visualization">
        <div class="doc-cards">
          <div class="doc-card" v-for="(type, index) in docTypes" :key="index"
            :style="{ transform: `rotate(${index * 5 - 10}deg)` }">
            <div class="doc-icon" :class="type.class">
              <i :class="type.icon"></i>
            </div>
            <span>{{ type.name }}</span>
          </div>
        </div>
      </div>
    </div>

    <div class="stats-panel">
      <div class="stat-item" v-for="stat in stats" :key="stat.title">
        <div class="stat-value">{{ stat.value }}</div>
        <div class="stat-title">{{ stat.title }}</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Index",
  data() {
    return {
      docTypes: [
        { name: "哲学、宗教", icon: "el-icon-document", class: "contract" },
        { name: "社会科学总论", icon: "el-icon-money", class: "finance" },
        { name: "数理科学和化学", icon: "el-icon-cpu", class: "tech" },
        { name: "政治、法律", icon: "el-icon-notebook-2", class: "meeting" },
        { name: "医药、卫生", icon: "el-icon-user", class: "hr" }
      ],
      stats: [
        { value: "99.7%", title: "分类准确率" },
        { value: "50+", title: "支持格式" },
        { value: "0.5s", title: "平均处理时间" },
        { value: "∞", title: "扩展能力" }
      ]
    };
  }
};
</script>

<style scoped lang="scss">
.home {
  height: 100vh;
  padding: 0;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;

  .compact-hero {
    flex: 1;
    display: flex;
    padding: 0 5%;
    align-items: center;

    .hero-content {
      flex: 1;

      h1.gradient-text {
        font-size: 5rem;
        font-weight: 800;
        margin: 0;
        background: linear-gradient(90deg, #409EFF 0%, #67C23A 50%, #E6A23C 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;

        span {
          color: #303133;
          -webkit-text-fill-color: initial;
        }
      }

      .slogan {
        font-size: 1.5rem;
        color: #606266;
        margin: 0.5rem 0;
      }

      .description {
        font-size: 1.1rem;
        color: #909399;
        margin: 1.5rem 0 2.5rem;
        line-height: 1.6;
      }

      .explore-btn {
        padding: 1rem 2.5rem;
        font-size: 1.1rem;
        font-weight: 500;
        border-radius: 50px;
        box-shadow: 0 10px 20px rgba(64, 158, 255, 0.3);

        i {
          margin-right: 8px;
        }
      }

      .pulse {
        animation: pulse 2s infinite;
      }
    }

    .visualization {
      flex: 1;
      position: relative;
      height: 100%;

      .doc-cards {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 500px;
        height: 500px;

        .doc-card {
          position: absolute;
          width: 120px;
          height: 120px;
          background: white;
          border-radius: 15px;
          display: flex;
          flex-direction: column;
          align-items: center;
          justify-content: center;
          box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
          transition: all 0.3s ease;

          &:hover {
            transform: scale(1.1) !important;
            z-index: 10;
          }

          .doc-icon {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 28px;
            color: white;
            margin-bottom: 10px;

            &.contract {
              background: #409EFF;
            }

            &.finance {
              background: #67C23A;
            }

            &.tech {
              background: #E6A23C;
            }

            &.meeting {
              background: #F56C6C;
            }

            &.hr {
              background: #909399;
            }
          }

          span {
            font-size: 14px;
            font-weight: 500;
            color: #606266;
          }
        }

        .doc-card:nth-child(1) {
          top: 10%;
          left: 50%;
        }

        .doc-card:nth-child(2) {
          top: 30%;
          left: 20%;
        }

        .doc-card:nth-child(3) {
          top: 70%;
          left: 20%;
        }

        .doc-card:nth-child(4) {
          top: 80%;
          left: 50%;
        }

        .doc-card:nth-child(5) {
          top: 30%;
          left: 80%;
        }
      }
    }
  }

  .stats-panel {
    display: flex;
    background: white;
    padding: 1.5rem 5%;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);

    .stat-item {
      flex: 1;
      text-align: center;
      padding: 1rem;

      .stat-value {
        font-size: 2rem;
        font-weight: 700;
        color: #409EFF;
        margin-bottom: 0.5rem;
      }

      .stat-title {
        font-size: 1rem;
        color: #909399;
      }
    }
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(64, 158, 255, 0.4);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(64, 158, 255, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(64, 158, 255, 0);
  }
}
</style>